import type { ProColumns } from '@ant-design/pro-table';
import { modelInfoType } from './data.d';

const columnsData: ProColumns<modelInfoType>[] = [
  // 配置搜索框
  {
    title: '名称',
    dataIndex: 'name',
    hideInTable: true,
  },
  {
    title: '标识编码',
    dataIndex: 'key',
    hideInTable: true,
  },
  // 表头
  {
    title: '名称',
    dataIndex: 'name',
    hideInSearch: true,
    width: 200,
    fixed: true,
  },
  {
    title: '标识编码',
    dataIndex: 'key',
    width: 200,
    hideInSearch: true,
  },
  {
    title: '版本',
    dataIndex: 'version',
    width: 100,
    hideInSearch: true,
  },
  {
    title: '部署',
    dataIndex: 'deploy',
    width: 100,
    hideInSearch: true,
    valueEnum: {
      undeploy: {
        text: '未解决',
        status: 'Error',
      },
      deployed: {
        text: '已解决',
        status: 'Success',
        disabled: true,
      },
    },
  },
  {
    title: '创建时间',
    width: 200,
    dataIndex: 'created',
    hideInSearch: true,
  },
  {
    title: '操作',
    dataIndex: 'action',
    hideInSearch: true,
    width: 180,
    fixed: 'right',
  },
];

// 树的数据
const treeData = [
  {
    title: '总经办',
    key: '0',
    children: [
      {
        title: '项目审批',
        key: '1',
      },
    ],
  },
  {
    title: 'HR人事',
    key: '2',
    children: [
      {
        title: '员工休假',
        key: '3',
      },
      {
        title: '员工入职',
        key: '4',
      },
      {
        title: '招聘面试',
        key: '5',
      },
    ],
  },
  {
    title: '财务',
    key: '6',
    children: [
      {
        title: '采购类',
        key: '7',
      },
      {
        title: '报销类',
        key: '8',
      },
    ],
  },
];

// 模型类型
const ModelType = [
  {
    value: 0,
    label: '流程模型',
  },
  {
    value: 2,
    label: '表单模型',
  },
  {
    value: 3,
    label: '应用模型',
  },
  {
    value: 4,
    label: '决策表模型',
  },
  {
    value: 5,
    label: '案例模型',
  },
];

export { columnsData, treeData, ModelType };
